package com.example.mine_platform.commom;


public enum Sex {
    MAN( false,  "男"),
    WOMAN(true,  "女");
    Boolean code;
    String value;
    Sex(Boolean code,String value) {
        this.code = code;
        this.value = value;
    }
    public Boolean getCode() {
        return code;
    }

    public void setCode(Boolean code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
    public static String getValueByCode(Boolean code){
        for(Sex sex:Sex.values()){
            if(code.equals(sex.getCode())){
                return sex.getValue();
            }
        }
        return  null;
    }
    public static Boolean getCodeByValue(String value){
        for(Sex sex:Sex.values()){
            if(value.equals(sex.getValue())){
                return sex.getCode();
            }
        }
        return  null;
    }

}
